feat: measurement-validator foundation + Phase 3 reporting/CLI#5
Draft
feat: measurement-validator foundation + Phase 3 reporting/CLI#5
Conversation
…rt exports Agent-Logs-Url: https://github.com/Himaan1998Y/pretext/sessions/148a0bfd-8a33-48a6-9004-7e0f664cf343 Co-authored-by: Himaan1998Y <210527591+Himaan1998Y@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Critically analyze Phase 3 planning components
feat: measurement-validator foundation + Phase 3 reporting/CLI
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Phase 1 measurement-validator foundation and Phase 3 reporting/export layer described in the planning docs. The validator compares Pretext's computed line heights against DOM reference measurements and classifies divergence severity.
Core types (
src/measurement-validator/types.ts)MeasurementSample— text + font + maxWidth + lineHeight inputComparisonResult— Pretext height vs DOM height,diffPx,DivergenceSeverity(exact≤1px /minor≤4px /major≤20px /critical>20px),executionTimeMsValidatorReport— aggregate pass/fail stats over a result setComparator (
src/measurement-validator/comparator.ts)compare(sample)callsprepare()/layout(), measures DOMoffsetHeightvia a hidden off-screen<div>, diffs themsetLocale(sample.language)beforeprepare()and restoresundefinedafterNaNfordomHeight, marks severityexact)Test fixtures (
src/measurement-validator/test-suite.ts)Report exports (
src/measurement-validator/report-generator.ts)toJSON()— pretty-printed JSONtoCSV()— UTF-8 BOM, Excel-compatibletoMarkdown()— GitHub-flavoured table with pass/fail summary linetoHTML()— single-file, zero external deps, minimal CSSCLI (
scripts/validator.ts)Exits
0when all results areexact,1otherwise.Original prompt
Phase 3 Review & Refinement: Critical Analysis & Reasoning
EXECUTIVE SUMMARY OF REVIEW
This document critically re-examines Phase 3 planning through multiple lenses:
CRITICAL ANALYSIS BY COMPONENT
COMPONENT 1: HTML DASHBOARD 📊
Initial Assumption: "Visual representation is a must-have"
Critical Review:
Who Uses HTML Dashboards?
User Research Finding:
Based on industry patterns:
Cost-Benefit Analysis
Recommendation: ✅ KEEP but SIMPLIFY
Refined Spec:
COMPONENT 2: CSV/MARKDOWN EXPORT 📄
Initial Assumption: "Need multiple export formats"
Critical Review:
Real Use Case Analysis
Market Validation:
Actual User Flow:
Cost-Benefit Analysis
Recommendation: ✅ KEEP both, but prioritize CSV
COMPONENT 3: GITHUB ACTIONS ⚙️
Initial Assumption: "CI/CD integration is essential"
Critical Review:
Dependency Chain Analysis
Use Case Validation
Risk Assessment:
Recommendation:⚠️ DEFER to Phase 4 (but plan now)
Reasoning:
Alternative (Phase 3): Create only the validation script (reusable in many contexts)
``...
This pull request was created from Copilot chat.